const fs = require('node:fs')

class StaticController {
    async readFile(ctx, next) {
        const { filename, mimetype } = ctx.fileInfo
        ctx.set('Content-Type', mimetype)
        ctx.body = fs.createReadStream(`./static/${filename}`)
    }
}

module.exports = new StaticController()